package com.xpsoft.oa.workflow.event;

import org.jbpm.api.jpdl.DecisionHandler;
import org.jbpm.api.model.OpenExecution;

import com.xpsoft.oa.model.system.AppUser;

//判断
public class StaffLeaveApplySecondHandler implements DecisionHandler {

	@Override
	public String decide(OpenExecution execution) {

		String result = "";
		//获取流程发起者对象
		AppUser flowStartUser=(AppUser)execution.getProcessInstance().getVariable("flowStartUser");
		String deptName = flowStartUser.getDepartment().getDepName();
		if(deptName.contains("工程")){
			result = "工程部";
		}else{
			result = "非工程部";
		}
		return result;
	}

}
